﻿// Copyright 2008 (c) Michael Reichenauer, SWEDEN. All rights reserved.
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PSMock.Implementation;

namespace PSMock
{



	public class MethodOption : Option
	{
		public MethodOption(MockedFunction mockedFunction) : base(mockedFunction) { }

		public Option Condition(Func<bool> predicate)
		{
			mockedFunction.Condition = predicate;
			return this;
		}
		public Option Do(Action method)
		{
			mockedFunction.Function = method;
			return this;
		}

	}


	public class MethodMock<T1> : Option
	{
		public MethodMock(MockedFunction mockedFunction) : base(mockedFunction) { }

		public MethodMock<T1> Condition(Func<T1, bool> predicate)
		{
			mockedFunction.Condition = predicate;
			return this;
		}
		public void Do(Action<T1> method)
		{
			mockedFunction.Function = method;
		}
	}

	public class MethodMock<T1, T2> : Option
	{
		public MethodMock(MockedFunction mockedFunction) : base(mockedFunction) { }

		public MethodMock<T1, T2> Condition(Func<T1, T2, bool> predicate)
		{
			mockedFunction.Condition = predicate;
			return this;
		}
		public void Do(Action<T1, T2> method)
		{
			mockedFunction.Function = method;
		}
	}

	public class MethodMock<T1, T2, T3> : Option
	{
		public MethodMock(MockedFunction mockedFunction) : base(mockedFunction) { }

		public MethodMock<T1, T2, T3> Condition(Func<T1, T2, T3, bool> predicate)
		{
			mockedFunction.Condition = predicate;
			return this;
		}
		public void Do(Action<T1, T2, T3> method)
		{
			mockedFunction.Function = method;
		}
	}

	public class MethodMock<T1, T2, T3, T4> : Option
	{
		public MethodMock(MockedFunction mockedFunction) : base(mockedFunction) { }

		public MethodMock<T1, T2, T3, T4> Condition(Func<T1, T2, T3, T4, bool> predicate)
		{
			mockedFunction.Condition = predicate;
			return this;
		}
		public void Do(Action<T1, T2, T3, T4> method)
		{
			mockedFunction.Function = method;
		}
	}
}
